Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SF-3155 Fix incorrect draft source language codes #2963

Merged
merged 1 commit into from
Jan 27, 2025
Merged

Conversation

pmachapman
Copy link
Collaborator

@pmachapman pmachapman commented Jan 19, 2025

This PR fixes the incorrect language codes for resources created in Paratext 8 by retrieving the language code from the Settings XML (in this case an SSF file) instead of from the LDML file which will usually default to English in these cases.

This change is Reviewable

@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label Jan 19, 2025
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.02%. Comparing base (6eeda05) to head (3db329c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2963   +/-   ##
=======================================
  Coverage   82.02%   82.02%           
=======================================
  Files         544      544           
  Lines       31685    31689    +4     
  Branches     5152     5149    -3     
=======================================
+ Hits        25989    25993    +4     
  Misses       4927     4927           
  Partials      769      769           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pmachapman pmachapman marked this pull request as ready for review January 19, 2025 19:40
Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pmachapman)


src/SIL.XForge.Scripture/Services/ParatextService.cs line 1851 at r1 (raw file):

    {
        using ScrText scrText = GetScrText(userSecret, ptProjectId);
        return GetWritingSystem(scrText.Settings.LanguageID.Id);

Is this where the problem is occurring? Somehow the Settings.LanguageId is the better way to calculate the WritingSystem?

@RaymondLuong3 RaymondLuong3 self-assigned this Jan 20, 2025
Copy link
Collaborator Author

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3)


src/SIL.XForge.Scripture/Services/ParatextService.cs line 1851 at r1 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

Is this where the problem is occurring? Somehow the Settings.LanguageId is the better way to calculate the WritingSystem?

Yes - Settings.LanguageID.Id retrieves the language directly from the Settings XML (and so compatible with Paratext 8 resources or projects), while Language.Id uses the language defintion file.

Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @pmachapman)

@Nateowami
Copy link
Collaborator

@pmachapman I'm pretty sure based on hearing a bit of conversation that this is a bugfix, but "Retrieve the language code from Settings" isn't actually giving any information about the nature of this change. Presumably you were getting it from somewhere else in the past, and it was unreliable, so now you're getting it from a more accurate location?

Our guidelines for commit messages (and PR titles) state:

Explain what changed, not how it changed
The summary should explain what happens from a user's perspective, not what you did to fix a bug

In this case I think it should probably say something like "Fix incorrect draft source language codes," and then the commit/PR body could say "get them from settings instead" (though I still don't know how that makes a difference -- maybe it's immaterial).

@pmachapman pmachapman changed the title SF-3155 Retrieve the language code from Settings SF-3155 Fix incorrect draft source language codes Jan 21, 2025
Copy link
Collaborator Author

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nateowami Thanks for catching that. I was thinking like a programmer :-/

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @pmachapman)

@pmachapman pmachapman added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Jan 22, 2025
@Nateowami Nateowami added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Jan 27, 2025
@Nateowami Nateowami enabled auto-merge (squash) January 27, 2025 15:35
@Nateowami Nateowami merged commit 0f38c4f into master Jan 27, 2025
14 of 15 checks passed
@Nateowami Nateowami deleted the fix/SF-3155 branch January 27, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing complete Testing of PR is complete and should no longer hold up merging of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants